import Vue from 'vue';
import Router from 'vue-router';
import cloudVideo from './cloudVideo';
import apointment from './apointment';

Vue.use(Router);

export default new Router({
  routes: [
    ...cloudVideo,
    ...apointment,
    {
      path: '/entry/',
      component: () => import('@/components/LayoutContent'),
      children: [
        {
          path: 'index',
          component: () => import('@/pages/index'),
          meta: { requiresAuth: true }
        }
      ]
    },
    {
      path: '/',
      component: () => import('@/components/LayoutLogin'),
      children: [
        {
          path: '',
          redirect: '/entry/index'
        },
        {
          path: 'login',
          component: () => import('@/pages/login')
        },
        {
          path: 'modifyPassword',
          component: () => import('@/pages/modifyPassword')
        }
      ]
    },
    {
      path: '*',
      component: () => import('@/pages/page404')
    }
  ],
});
